package main

import "fmt"


type CInterface interface {
	delete(rule string)
}

type ControllerInterface interface {
	get(rule string)
	post(rule string)
	put(rule string)

}

type Controller struct {
	TplExt string
	Layout string
}

func (c Controller) get (rule string) {
	fmt.Print("Method GET ", rule, "\r\n")
}

func (c Controller) post (rule string) {
	fmt.Print("Method POST ", rule, "\r\n")
}

func (c Controller) put (rule string) {
	fmt.Print("Method PUT ", rule, "\r\n")
}

func call (c ControllerInterface) {
	c.get("Do...")

	//断言
	v, ok := c.(CInterface);

	fmt.Print(v, ok)

	//switch断言
	switch str := c.(type) {
		case ControllerInterface :
			fmt.Print("Yes： ", str)
	}
	//if t, ok := c.(*ControllerInterface); ok {
	//	fmt.Println("Type ", t)
	//}
}

func main () {
	var c Controller = Controller{
		"html",
		"view",
	}

	call(c)
}